<template>
  <div>
    <el-select v-model="selectqu" placeholder="请选择区" :disabled="jinyong">
      <el-option
        v-for="item in qus"
        :key="item.value"
        :label="item.name"
        :value="item.value"
      >
      </el-option>
    </el-select>
  </div>
</template>


<script>
export default {
  data() {
    return {
      qus: [],
      selectqu: "",
      jinyong: true,
    };
  },
  methods: { },
  watch: {
    selectqu() {
      this.$emit("selectqufangfa", this.selectqu);
    },
  },
  created() {
    // 市管理员
    if (this.$store.state.level == "0") {
      this.qus = this.$store.state.district;
      this.selectqu = this.qus[0].value;
      this.jinyong = false;
    }
    // 区管理员
    else if (this.$store.state.level == "1") {
      this.qus = this.$store.state.district;
      this.selectqu = this.qus[0].value;
      this.jinyong = true;
    }
    // 镇管理员
    else if (this.$store.state.level == "2") {
      this.qus = this.$store.state.district;
      this.selectqu = this.qus[0].value;
      this.jinyong = true;
    }
    // 村管理员
    else if (this.$store.state.level == "3") {
      this.qus = this.$store.state.district;
      this.selectqu = this.qus[0].value;
      this.jinyong = true;
    }
  },
};

</script>

<style lang="less" scoped>
</style>